<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>test!</title>
    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="夜读书FM,电台">
    <meta name="description" content="">
    <meta name="keywords" content="音乐,情感">
    <script src="http://www.yedushu.com/scripts/ximalaya/xmsdk.min.js"></script>
    <script src="http://www.yedushu.com/scripts/ximalaya/vue.min.js"></script>
</head>
<body>
<div class="page">
    

    <h2 style="color:red">搜索相关API</h2>

    <h1>搜索专辑 /search/albums</h1>
    <div id="search_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>搜索声音 /search/tracks</h1>
    <div id="search_tracks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>多筛选条件搜索专辑 /v2/search/albums</h1>
    <div id="v2_search_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>多筛选条件搜索声音 /v2/search/tracks</h1>
    <div id="v2_search_tracks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取热搜词 /search/hot_words</h1>
    <div id="search_hot_words">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>搜索词自动提示 /search/suggest_words</h1>
    <div id="search_suggest_words">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h2 style="color:red">个性化数据推荐API</h2>

    <h1>获取猜你喜欢专辑信息 /v2/albums/guess_like</h1>
    <div id="v2_albums_guess_like">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取某个专辑的相关专辑信息 /v2/albums/relative_album</h1>
    <div id="v2_albums_relative_album">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取某个声音的相关专辑信息 /v2/tracks/relative_album</h1>
    <div id="v2_tracks_relative_album">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取一键听的频道列表 /one_click_listen/channels</h1>
    <div id="one_click_listen_channels">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取当前频道下的下一条声音 /one_click_listen/get_next_track</h1>
    <div id="one_click_listen_get_next_track">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h2 style="color:red">用户隐私数据API</h2>


    <h2 style="color:red">获取付费内容API</h2>

    <h1>获取所有付费专辑 /open_pay/all_paid_albums</h1>
    <div id="open_pay_all_paid_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取付费精品的标签列表 /open_pay/tags</h1>
    <div id="open_pay_tags">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取某个标签下的付费专辑列表 /open_pay/paid_albums_by_tag</h1>
    <div id="open_pay_paid_albums_by_tag">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取付费专辑下的声音列表 /open_pay/browse_paid_album_tracks</h1>
    <div id="open_pay_browse_paid_album_tracks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>批量获取付费专辑 /open_pay/batch_get_paid_albums</h1>
    <div id="open_pay_batch_get_paid_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>批量获取付费声音信息 /open_pay/batch_get_paid_tracks</h1>
    <div id="open_pay_batch_get_paid_tracks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取用户所有已购付费专辑信息 /open_pay/get_bought_albums</h1>
    <div id="open_pay_get_bought_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取专辑的购买状态 /open_pay/album_bought_status</h1>
    <div id="open_pay_album_bought_status">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取声音的购买状态 /open_pay/track_bought_status</h1>
    <div id="open_pay_track_bought_status">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>搜索付费专辑 /open_pay/search_paid_albums</h1>
    <div id="open_pay_search_paid_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>搜索付费声音 /open_pay/search_paid_tracks</h1>
    <div id="open_pay_search_paid_tracks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取付费内容排行榜 /open_pay/paid_content_ranks</h1>
    <div id="open_pay_paid_content_ranks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取付费榜单下的付费专辑列表 /open_pay/rank_albums</h1>
    <div id="open_pay_rank_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

     <h2 style="color:red">购买付费内容API</h2>

     <h2 style="color:red">直充业务API</h2>

     <h2 style="color:red">站外优惠券业务API</h2>

     <h2 style="color:red">点播数据同步API</h2>

    <h1>获取全量专辑数据 albums_get_all</h1>
    <div id="albums_get_all">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取专辑增量数据 /incr/albums</h1>
    <div id="incr_albums">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>获取声音增量数据 /incr/tracks</h1>
    <div id="incr_tracks">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>实时推送专辑/声音的上下架状态 /ximalaya/open_push</h1>
    <div id="ximalaya_open_push">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h1>实时通知付费专辑信息有更新 /ximalaya/notice_pay_album_update</h1>
    <div id="ximalaya_notice_pay_album_update">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>

    <h2 style="color:red">获取视频播放地址API</h2>

    <h2 style="color:red">播放数据回传API</h2>

    <h1>批量回传播放数据 /openapi-collector-app/track_batch_records</h1>
    <div id="openapi-collector-app_track_batch_records">
        <ol>
            <li v-for="row in rows">
                @{{row}}
            </li>
        </ol>
    </div>





    

    
</div> 

<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->
<!-- ******************************************* -->


<script>
    const { config } = window.xmsdk;

    config({
        app_key: '5e3de3aa76d5201658463c03abf6fbc1', 
        sig_url: 'http://www.yedushu.com/yefm/jssdk_sig', 
        device_id: 'u0sdfu09s80f9809sdf8908sfk', 
        timeout: 10 * 1000,
        debug: true
    });

    const { XMLY, XMplayer } = window.xmsdk;
    const xmly = new XMLY();    

    //搜索专辑
    xmly.request({
        url: 'https://api.ximalaya.com/search/albums',
        type: 'get',
        params: {
            q: '小说',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#search_albums',
            data: {
                rows: res
            }
        });   
    }); 

    //搜索声音
    xmly.request({
        url: 'https://api.ximalaya.com/search/tracks',
        type: 'get',
        params: {
            q: '小说',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#search_tracks',
            data: {
                rows: res
            }
        });   
    }); 

    //多筛选条件搜索专辑
    xmly.request({
        url: 'https://api.ximalaya.com/v2/search/albums',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v2_search_albums',
            data: {
                rows: res
            }
        });   
    });

    //多筛选条件搜索声音
    xmly.request({
        url: 'https://api.ximalaya.com/v2/search/tracks',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v2_search_tracks',
            data: {
                rows: res
            }
        });   
    });

    //获取热搜词
    xmly.request({
        url: 'https://api.ximalaya.com/search/hot_words',
        type: 'get',
        params: {
            top: 20,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#search_hot_words',
            data: {
                rows: res
            }
        });   
    });

    //搜索词自动提示
    xmly.request({
        url: 'https://api.ximalaya.com/search/suggest_words',
        type: 'get',
        params: {
            q: '小说',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#search_suggest_words',
            data: {
                rows: res
            }
        });   
    });

    //获取猜你喜欢专辑信息
    xmly.request({
        url: 'https://api.ximalaya.com/v2/albums/guess_like',
        type: 'get',
        params: {
            device_type: 3,
            // device_id, 'u0sdfu09s80f9809sdf8908sfk',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v2_albums_guess_like',
            data: {
                rows: res
            }
        });   
    });

    //获取某个专辑的相关专辑信息
    xmly.request({
        url: 'https://api.ximalaya.com/v2/albums/relative_album',
        type: 'get',
        params: {
            album_id: 15828621
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v2_albums_relative_album',
            data: {
                rows: res
            }
        });   
    });

    //获取某个声音的相关专辑信息
    xmly.request({
        url: 'https://api.ximalaya.com/v2/tracks/relative_album',
        type: 'get',
        params: {
            track_id: 161721593
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#v2_tracks_relative_album',
            data: {
                rows: res
            }
        });   
    });

    //获取一键听的频道列表
    xmly.request({
        url: 'https://api.ximalaya.com/one_click_listen/channels',
        type: 'get',
        params: {
            // device_id: 'u0sdfu09s80f9809sdf8908sfk',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#one_click_listen_channels',
            data: {
                rows: res
            }
        });   
    });

    //获取当前频道下的下一条声音
    xmly.request({
        url: 'https://api.ximalaya.com/one_click_listen/get_next_track',
        type: 'get',
        params: {
            // device_id: 'u0sdfu09s80f9809sdf8908sfk',
            channel_id: 5,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#one_click_listen_get_next_track',
            data: {
                rows: res
            }
        });   
    });

    //获取所有付费专辑
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/all_paid_albums',
        type: 'get',
        params: {
            page: 1,
            count: 6,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_all_paid_albums',
            data: {
                rows: res
            }
        });   
    });

    //获取付费精品的标签列表
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/tags',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_tags',
            data: {
                rows: res
            }
        });   
    });

    //获取某个标签下的付费专辑列表
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/paid_albums_by_tag',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_paid_albums_by_tag',
            data: {
                rows: res
            }
        });   
    });

    //获取付费专辑下的声音列表
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/browse_paid_album_tracks',
        type: 'get',
        params: {
            album_id: 4534534,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_browse_paid_album_tracks',
            data: {
                rows: res
            }
        });   
    });

    //批量获取付费专辑
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/batch_get_paid_albums',
        type: 'get',
        params: {
            ids: '4534534,45435345',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_batch_get_paid_albums',
            data: {
                rows: res
            }
        });   
    });

    //批量获取付费声音信息
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/batch_get_paid_tracks',
        type: 'get',
        params: {
            ids: '4534534,45435345',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_batch_get_paid_tracks',
            data: {
                rows: res
            }
        });   
    });

    //获取用户所有已购付费专辑信息
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/get_bought_albums',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_get_bought_albums',
            data: {
                rows: res
            }
        });   
    });

    //获取专辑的购买状态
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/album_bought_status',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_album_bought_status',
            data: {
                rows: res
            }
        });   
    });

    //获取声音的购买状态
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/track_bought_status',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_track_bought_status',
            data: {
                rows: res
            }
        });   
    });

    //搜索付费专辑
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/search_paid_albums',
        type: 'get',
        params: {
            q: '小说',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_search_paid_albums',
            data: {
                rows: res
            }
        });   
    });

    //搜索付费声音
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/search_paid_tracks',
        type: 'get',
        params: {
            q: '小说',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_search_paid_tracks',
            data: {
                rows: res
            }
        });   
    });

    //获取付费内容排行榜
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/paid_content_ranks',
        type: 'get',
        params: {
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_paid_content_ranks',
            data: {
                rows: res
            }
        });   
    });

    //获取付费榜单下的付费专辑列表
    xmly.request({
        url: 'https://api.ximalaya.com/open_pay/rank_albums',
        type: 'get',
        params: {
            rank_key: '小说',
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#open_pay_rank_albums',
            data: {
                rows: res
            }
        });   
    });

    //获取全量专辑数据
    xmly.request({
        url: 'https://api.ximalaya.com/albums/get_all',
        type: 'get',
        params: {
            category_id: 19383749,
        }
    }).then(res => {
        console.log(res);
        new Vue({
            el: '#albums_get_all',
            data: {
                rows: res
            }
        });   
    });

    //获取专辑增量数据
    // xmly.request({
    //     url: 'https://api.ximalaya.com/incr/albums',
    //     type: 'get',
    //     params: {
    //         category_id: 19383749,
    //         start_time: (new Date(" 2018/06/22 08:00:20")).getTime()/1000,
    //         end_time: (new Date(" 2019/06/22 08:00:20")).getTime()/1000,
    //     }
    // }).then(res => {
    //     console.log(res);
    //     new Vue({
    //         el: '#incr_albums',
    //         data: {
    //             rows: res
    //         }
    //     });   
    // });

    //获取声音增量数据
    // xmly.request({
    //     url: 'https://api.ximalaya.com/incr/tracks',
    //     type: 'get',
    //     params: {
    //         album_id: 193749,
    //         start_time: (new Date(" 2018/06/22 08:00:20")).getTime()/1000,
    //         end_time: (new Date(" 2019/06/22 08:00:20")).getTime()/1000,
    //     }
    // }).then(res => {
    //     console.log(res);
    //     new Vue({
    //         el: '#incr_albums',
    //         data: {
    //             rows: res
    //         }
    //     });   
    // });

    //实时推送专辑/声音的上下架状态
    // xmly.request({
    //     url: 'https://api.ximalaya.com/ximalaya/open_push',
    //     type: 'get',
    //     params: {
    //         app_key: 193749,
    //         push_type: 1,
    //         id: 1,
    //         updated_at: (new Date(" 2018/06/22 08:00:20")).getTime()/1000,
    //         offline_reason_type: 1,
    //         // nonce: 'ssdfsdfsd',
    //         timestamp: time(),
    //         // sig: '32423423423432423423423',
    //     }
    // }).then(res => {
    //     console.log(res);
    //     new Vue({
    //         el: '#ximalaya_open_push',
    //         data: {
    //             rows: res
    //         }
    //     });   
    // });

    //实时通知付费专辑信息有更新
    // xmly.request({
    //     url: 'https://api.ximalaya.com/ximalaya/notice_pay_album_update',
    //     type: 'get',
    //     params: {
    //         app_key: 193749,
    //         album_id: 5343244,
    //         updated_at: (new Date(" 2018/06/22 08:00:20")).getTime()/1000,
    //         // nonce: 'sdfw3rfdssf',
    //         timestamp: time(),
    //         // sig: '34234234',
    //     }
    // }).then(res => {
    //     console.log(res);
    //     new Vue({
    //         el: '#ximalaya_open_push',
    //         data: {
    //             rows: res
    //         }
    //     });   
    // });

    //批量回传播放数据
    // xmly.request({
    //     url: 'https://api.ximalaya.com/openapi-collector-app/track_batch_records',
    //     type: 'post',
    //     params: {
    //         // device_id: '34234efdsfdsf',
    //         track_records: {
    //             track_id: 5464,
    //             duration:34,
    //             played_secs: 0,
    //             started_at: (new Date(" 2018/06/22 08:00:20")).getTime()/1000),
    //             play_type: 0,
    //         },
    //     }
    // }).then(res => {
    //     console.log(res);
    //     new Vue({
    //         el: '#openapi-collector-app_track_batch_records',
    //         data: {
    //             rows: res
    //         }
    //     });   
    // });

    
    
</script>
</body>
</html>
